package com.topisv.tms.entity.stock;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.topisv.tms.entity.AreaGroup;
import com.topisv.tms.entity.Customers;
import com.topisv.tms.entity.IdEntity;
import com.topisv.tms.entity.User;

/**
 * 商家库存_实体类
 */
@Entity
@Table(name = "cus_stock")
public class CusStock extends IdEntity implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private String boxCode;
	
	private String sku;
	
	private Customers customer;
	
	private String customerCode;
	
	private String partitionCode;
	
	private String pipeCode;
	
	private String shelfCode;
	
	private String stockCode;
	
	private Integer salesNum;
	
	private Integer unusedNum;
	
	private Integer orderNum;
	
	private Integer lockedNum;
	
	private Integer transportNum;
	
	private Integer airNum;
	
	private Date lastmodifyTime;
	
	private User lastopetator;
	
	private String warehouseCode;
	
	private String stockType;
	
	/**
	 * 箱子类型 ( common: 普通箱子  prepkg: 预包装箱子 )
	 */
	private String boxType;
	
	private int version;
	
	private String batchCode;
	
	private String productDate;
	
	private String expireDate;
	
	public String getBoxType() {
		return boxType;
	}

	public void setBoxType(String boxType) {
		this.boxType = boxType;
	}

	public String getBoxCode() {
		return boxCode;
	}

	public void setBoxCode(String boxCode) {
		this.boxCode = boxCode;
	}

	public String getWarehouseCode() {
		return warehouseCode;
	}

	public void setWarehouseCode(String warehouseCode) {
		this.warehouseCode = warehouseCode;
	}

	public String getSku() {
		return sku;
	}

	public void setSku(String sku) {
		this.sku = sku;
	}

	@ManyToOne
	@JoinColumn(name="customer_id")
	public Customers getCustomer() {
		return customer;
	}

	public void setCustomer(Customers customer) {
		this.customer = customer;
	}

	public String getCustomerCode() {
		return customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public String getPartitionCode() {
		return partitionCode;
	}

	public void setPartitionCode(String partitionCode) {
		this.partitionCode = partitionCode;
	}

	public String getPipeCode() {
		return pipeCode;
	}

	public void setPipeCode(String pipeCode) {
		this.pipeCode = pipeCode;
	}

	public String getShelfCode() {
		return shelfCode;
	}

	public void setShelfCode(String shelfCode) {
		this.shelfCode = shelfCode;
	}

	public String getStockCode() {
		return stockCode;
	}

	public void setStockCode(String stockCode) {
		this.stockCode = stockCode;
	}

	public Integer getSalesNum() {
		return salesNum;
	}

	public void setSalesNum(Integer salesNum) {
		this.salesNum = salesNum;
	}

	public Integer getUnusedNum() {
		return unusedNum;
	}

	public void setUnusedNum(Integer unusedNum) {
		this.unusedNum = unusedNum;
	}

	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public Integer getLockedNum() {
		return lockedNum;
	}

	public void setLockedNum(Integer lockedNum) {
		this.lockedNum = lockedNum;
	}

	public Integer getTransportNum() {
		return transportNum;
	}

	public void setTransportNum(Integer transportNum) {
		this.transportNum = transportNum;
	}

	public Integer getAirNum() {
		return airNum;
	}

	public void setAirNum(Integer airNum) {
		this.airNum = airNum;
	}

	public Date getLastmodifyTime() {
		return lastmodifyTime;
	}

	public void setLastmodifyTime(Date lastmodifyTime) {
		this.lastmodifyTime = lastmodifyTime;
	}

	@ManyToOne
	@JoinColumn(name="lastopeator_id")
	public User getLastopetator() {
		return lastopetator;
	}

	public void setLastopetator(User lastopetator) {
		this.lastopetator = lastopetator;
	}
	
	
	public String getStockType() {
		return stockType;
	}

	public void setStockType(String stockType) {
		this.stockType = stockType;
	}

	
	
    public String getBatchCode() {
        return batchCode;
    }

    
    public void setBatchCode(String batchCode) {
        this.batchCode = batchCode;
    }

    
    public String getProductDate() {
        return productDate;
    }

    
    public void setProductDate(String productDate) {
        this.productDate = productDate;
    }

    
    public String getExpireDate() {
        return expireDate;
    }

    
    public void setExpireDate(String expireDate) {
        this.expireDate = expireDate;
    }


    //dto属性
	private Integer totalNum;
	private AreaGroup warehouse;
	private String bar;
	private String spec;
	private String goodsName;
	private String moveFlg;

	@Transient
	public Integer getTotalNum() {
		return this.airNum+this.salesNum+this.unusedNum+this.orderNum+this.lockedNum+this.transportNum;
	}

	public void setTotalNum(Integer totalNum) {
		this.totalNum = totalNum;
	}

	@Transient
	public AreaGroup getWarehouse() {
		return warehouse;
	}

	public void setWarehouse(AreaGroup warehouse) {
		this.warehouse = warehouse;
	}

	@Transient
	public String getBar() {
		return bar;
	}

	public void setBar(String bar) {
		this.bar = bar;
	}

	@Transient
	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}

	@Transient
	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	@Version
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	@Transient
	public String getMoveFlg() {
		return moveFlg;
	}

	public void setMoveFlg(String moveFlg) {
		this.moveFlg = moveFlg;
	}
	
	
	
	

}